package com.platform.hjt.sys.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.map.annotate.JsonSerialize;

import com.platform.hjt.sys.model.json.SysPositionSerialize;

/**
 * SysPosition entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_position")
public class SysPosition implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -4302058734761353299L;
	private String positionId;
	private SysPosition sysPosition;
	private String positionName;
	private String fullPinyin;
	private String shortPinyin;
	private String positionType;

	// Constructors

	/** default constructor */
	public SysPosition() {
	}

	/** minimal constructor */
	public SysPosition(String positionId) {
		this.positionId = positionId;
	}

	/** full constructor */
	public SysPosition(String positionId, SysPosition sysPosition,
			String positionName, String fullPinyin, String shortPinyin,
			String positionType) {
		this.positionId = positionId;
		this.sysPosition = sysPosition;
		this.positionName = positionName;
		this.fullPinyin = fullPinyin;
		this.shortPinyin = shortPinyin;
		this.positionType = positionType;
	}

	// Property accessors
	@Id
	@Column(name = "position_id", unique = true, nullable = false, length = 50)
	public String getPositionId() {
		return this.positionId;
	}

	public void setPositionId(String positionId) {
		this.positionId = positionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "super_id")
	@JsonSerialize(using = SysPositionSerialize.class)
	public SysPosition getSysPosition() {
		return this.sysPosition;
	}

	public void setSysPosition(SysPosition sysPosition) {
		this.sysPosition = sysPosition;
	}

	@Column(name = "position_name", length = 50)
	public String getPositionName() {
		return this.positionName;
	}

	public void setPositionName(String positionName) {
		this.positionName = positionName;
	}

	@Column(name = "full_pinyin", length = 200)
	public String getFullPinyin() {
		return this.fullPinyin;
	}

	public void setFullPinyin(String fullPinyin) {
		this.fullPinyin = fullPinyin;
	}

	@Column(name = "short_pinyin", length = 50)
	public String getShortPinyin() {
		return this.shortPinyin;
	}

	public void setShortPinyin(String shortPinyin) {
		this.shortPinyin = shortPinyin;
	}

	@Column(name = "position_type", length = 10)
	public String getPositionType() {
		return this.positionType;
	}

	public void setPositionType(String positionType) {
		this.positionType = positionType;
	}

}